<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            width: 100px;
            height: 200px;
            background-color: pink;
             
        }
        .content{
            display: none;
            width: 300px;
            height: 100px;
            background-color: aqua;
        }
    </style>
</head>
<body>
    <div class="box">
        <input type="text" class="user" placeholder="搜索">
        <div class="content">
            <div>1</div>
            <div>2</div>
            <div>3</div>
            <div>4</div>
            <div>5</div>
        </div>
    </div>
    <script>
        const input=document.querySelector('.user')
        const content=document.querySelector('.content')
        input.addEventListener('focus',function(){
            content.style.display='block'
            input.addEventListener('blur',function(){
                content.style.display='none'
            })

            
        })



    </script>
 
        

</body>
</html>